var staticPath = "http://img.juduocai.top";
var uploadPath = "http://upload.juduocai.top";
var swfu;
function  swfupload(id) {
    var settings = {
        flash_url : "/lib/swfupload/swfupload.swf",
        upload_url: uploadPath+"/upload/images/header",
        post_params:{id:id},
        file_size_limit : "10 MB",
        file_types : "*.jpg;*.png;*.jpeg;*.bmp",
        file_types_description : "All Files",
        file_upload_limit :10000,  //配置上传个数
        file_queue_limit : 0,
        custom_settings : {
            progressTarget : "fsUploadProgress",
            cancelButtonId : "btnCancel"
        },
        debug: false,
        // Button settings
        button_image_url: "/lib/swfupload/images/TestImageNoText_65x29.png",
        button_width: "60",
        button_height: "36",
        button_placeholder_id: id,
        button_text: '<span class="theFont" >上传</span>',
        button_text_style: ".theFont { font-size: 14px;color:#ffffff;}",
        button_text_left_padding: 12,
        button_text_top_padding: 6,

        file_queued_handler : fileQueued,
        file_queue_error_handler : fileQueueError,
        file_dialog_complete_handler : fileDialogComplete,
        upload_start_handler : uploadStart,
        upload_progress_handler : uploadProgress,
        upload_error_handler : uploadError,
        upload_success_handler : upload_Success,
        upload_complete_handler : uploadComplete,
        queue_complete_handler : queueComplete
    };
    swfu = new SWFUpload(settings);
}

$(function(){
    $(".upload_img").each(function(){
        swfupload($(this).attr('id'));
    });
});
